"use strict";(self.webpackChunkpromptmanager=self.webpackChunkpromptmanager||[]).push([[5034],{7543:function(e,n,t){t.d(n,{B6:function(){return u},qC:function(){return i},rQ:function(){return o}});var r=t(74165),a=t(15861),s=function(e){var n=document.cookie.split(";").find((function(n){return n.trim().startsWith("".concat(e,"="))}));return n?n.split("=")[1]:null},o=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n,t,a,s){var o,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t(!0),e.next=4,fetch(n);case 4:if((o=e.sent).ok){e.next=7;break}throw new Error(o.statusText);case 7:return e.next=9,o.json();case 9:i=e.sent,a(i),t(!1),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),s(e.t0.message),t(!1);case 18:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(n,t,r,a){return e.apply(this,arguments)}}(),i=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n,t,a,o,i){var u,c;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":s("csrftoken")},body:JSON.stringify(t)});case 3:return u=e.sent,e.next=6,u.json();case 6:c=e.sent,o(c),a(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),i(e.t0.message),a(!1);case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(n,t,r,a,s){return e.apply(this,arguments)}}(),u=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n,t,a,o,i){var u,c;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRFToken":s("csrftoken")},body:JSON.stringify(t)});case 3:return u=e.sent,e.next=6,u.json();case 6:c=e.sent,o(c),a(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),i(e.t0.message),a(!1);case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(n,t,r,a,s){return e.apply(this,arguments)}}()},5034:function(e,n,t){t.r(n),t.d(n,{default:function(){return v}});var r=t(74165),a=t(15861),s=t(29439),o=t(72791),i=t(64554),u=t(48550),c=t(24518),l=t(89164),f=t(35527),p=t(93457),d=t(7543);var m=t.p+"static/media/llmstack-logo.75afde00e3dff933d2171db715dbe225.svg",h=t(80184),x=(0,p.Z)("img")({width:"60%",marginBottom:20});function v(){var e=(0,o.useState)(""),n=(0,s.Z)(e,2),t=n[0],p=n[1],v=(0,o.useState)(""),g=(0,s.Z)(v,2),w=g[0],Z=g[1],k=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),t&&w){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,(0,d.qC)("/api/login",{username:t,password:w},(function(){}),(function(e){window.location.href="/"}));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,h.jsx)(l.Z,{maxWidth:"xs",children:(0,h.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",minHeight:"100vh",justifyContent:"center"},children:(0,h.jsxs)(f.Z,{elevation:3,sx:{p:2,width:"100%",textAlign:"center"},children:[(0,h.jsx)(x,{src:m,alt:"logo",sx:{mt:6}}),(0,h.jsxs)(i.Z,{component:"form",noValidate:!0,sx:{margin:3},children:[(0,h.jsx)(u.Z,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"username",label:"Username",name:"username",autoComplete:"username",autoFocus:!0,onChange:function(e){return p(e.target.value)},value:t}),(0,h.jsx)(u.Z,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:function(e){return Z(e.target.value)},value:w}),(0,h.jsx)(c.Z,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",size:"large",sx:{mt:4,mb:4,textTransform:"none"},onClick:k,children:"Sign In"})]})]})})})}}}]);
//# sourceMappingURL=5034.c1eb279b.chunk.js.map